<?php
	/**
	 * Value object representation of a system group.
	 */
	class GroupVO {
		
		var $_explicitType="vo.GroupVO";
		
		/** The unique ID of the group. */
		var $groupUID;
		
		/** The name of the group. */
		var $groupName;
		
		/** A short description of the group. */
		var $description;
		
		/** The path to a logo of the group. */
		var $logoURL;
		
		/** The group's AFCS chat room url. */
		var $chatURL;
		
		/** True, if the logged in user manages the group. */
		var $isManager;
		
		/** The members belonging to the group. */
		var $members;
		
		/** The sponsors of the group. */
		var $sponsors;
		
		/** The modules the group has access to. */
		var $modules;
		
		/** Creates a new instance of a GroupVO. */
		public function GroupVO() {}
		
		/**
		 * Maps a database record to a GroupVO.
		 * @param $row The record to map to a GroupVO.
		 * @return A new mapped instance of a GroupVO.
		 */
		public static function mapObject($row) {
			
			$vo = new GroupVO();
			
			$vo->groupUID 		= $row["groupUID"];
			$vo->groupName 		= $row["groupName"];
			$vo->description 	= $row["description"];
			$vo->logoURL 		= $row["logoURL"];
			$vo->chatURL 		= $row["chatURL"];
			$vo->isManager 		= ($row["isManager"] == 1? true:false);
			
			return $vo;
		}
	}
?>